package legoproject.Tests;

import legoproject.*;
import lejos.nxt.*;

public class BTTester {
    private static BluetoothManager manager = new BluetoothManager();

    public static void main(String Args[]) throws Exception{
        manager.init();
        while(true){
            if(Button.ESCAPE.isPressed()){
                LCD.clear();
                LCD.drawInt(manager.sendCommand(CommandType.GRAB),0,0);
                LCD.refresh();
                Thread.sleep(1000);
            }
            if(Button.ENTER.isPressed()){
                LCD.clear();
                LCD.drawInt(manager.sendCommand(CommandType.RELEASEGRAB),0,0);
                LCD.refresh();
                Thread.sleep(1000);
            }
            if(Button.LEFT.isPressed()){
                LCD.clear();
                LCD.drawInt(manager.sendCommand(CommandType.READTOUCH),0,0);
                LCD.refresh();
                Thread.sleep(1000);
            }
        }
    }
}
